import type { ComponentType } from './types/index';
/**
 * @description: 生成placeholder
 */
export function createPlaceholderMessage(component: ComponentType) {
  if (
    component.includes('Input') ||
    component.includes('Nickname') ||
    component.includes('InputNumber') ||
    component.includes('InputTextArea') ||
    component.includes('InputPhone') ||
    component.includes('InputSearch') ||
    component.includes('Honor')
  ) {
    return '请输入';
  }
  if (
    component.includes('Select') ||
    component.includes('TimePicker') ||
    component.includes('DatePicker') ||
    component.includes('RadioGroup') ||
    component.includes('YearPicker') ||
    component.includes('CheckboxGroup') ||
    component.includes('UploadFile') ||
    component.includes('UploadImg') ||
    component.includes('UploadVideo') ||
    component.includes('ChooseLocation') ||
    component.includes('ApplyTable') ||
    component.includes('AreaPicker') ||
    component.includes('AreaStreetPicker') ||
    component.includes('SelectIndustry')
  ) {
    return '请选择';
  }
  return '';
}

/** 部分组件强制LabelPosition ==> top */
export const comLabelPositionTop = [
  'Honor',
  'UploadVideo',
  'UploadImg',
  'UploadFile',
  'ApplyTable',
  'InputSearch',
  'InputTextArea',
  'Attachment',
  'SelectIndustry'
];

export const DATE_TYPE = ['PickerDate'];

export const defaultValueComponents = [
  'Input',
  'Nickname',
  'InputNumber',
  'InputTextArea',
  'CheckboxGroup',
  'RadioGroup'
];

export const defaultArrayValueComponents = [
  'UploadFile',
  'UploadImg',
  'UploadVideo',
  'FormHonor',
  'SelectIndustry',
  'ApplyTable',
  'InputSearch',
  'AreaStreetPicker',
  'AreaPicker'
];

/** 默认需要监听change的组件 */
export const defaultOnchangeCompoents = ['InputSearch']

/** 后管默认值不与defaultValue同步的组件 */
export const notSetItemDefaultComponents: Array<ComponentType> = ['AreaStreetPicker']

/** 不需要提交值的组件 */
export const notSubmitComponents: Array<ComponentType> = ['Divider', 'Attachment']
